export default asm`
(func $atomics_load8 (export "load8") (param $p0 i32) (result i32)
  (local.get $p0)
  (i32.atomic.load8_u)
)

(func $load16 (export "load16") (param $p0 i32) (result i32)
  (local.get $p0)
  (i32.atomic.load16_u)
)

(func $load32 (export "load32") (param $p0 i32) (result i32)
  (local.get $p0)
  (i32.atomic.load)
)

(func $load64 (export "load64") (param $p0 i32) (result i64)
  (local.get $p0)
  (i64.atomic.load)
)

(func $store8 (export "store8") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.store8)
  (local.get $p1)
)

(func $store16 (export "store16") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.store16)
  (local.get $p1)
)

(func $store32 (export "store32") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.store)
  (local.get $p1)
)

(func $store64 (export "store64") (param $p0 i32) (param $p1 i64) (result i64)
  (local.get $p0)
  (local.get $p1)
  (i64.atomic.store)
  (local.get $p1)
)

(func $add8 (export "add8") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw8.add_u)
)

(func $add16 (export "add16") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw16.add_u)
)

(func $add32 (export "add32") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw.add)
)

(func $add64 (export "add64") (param $p0 i32) (param $p1 i64) (result i64)
  (local.get $p0)
  (local.get $p1)
  (i64.atomic.rmw.add)
)

(func $sub8 (export "sub8") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw8.sub_u)
)

(func $sub16 (export "sub16") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw16.sub_u)
)

(func $sub32 (export "sub32") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw.sub)
)

(func $sub64 (export "sub64") (param $p0 i32) (param $p1 i64) (result i64)
  (local.get $p0)
  (local.get $p1)
  (i64.atomic.rmw.sub)
)

(func $and8 (export "and8") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw8.and_u)
)

(func $and16 (export "and16") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw16.and_u)
)

(func $and32 (export "and32") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw.and)
)

(func $and64 (export "and64") (param $p0 i32) (param $p1 i64) (result i64)
  (local.get $p0)
  (local.get $p1)
  (i64.atomic.rmw.and)
)

(func $or8 (export "or8") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw8.or_u)
)

(func $or16 (export "or16") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw16.or_u)
)

(func $or32 (export "or32") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw.or)
)

(func $or64 (export "or64") (param $p0 i32) (param $p1 i64) (result i64)
  (local.get $p0)
  (local.get $p1)
  (i64.atomic.rmw.or)
)

(func $xor8 (export "xor8") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw8.xor_u)
)

(func $xor16 (export "xor16") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw16.xor_u)
)

(func $xor32 (export "xor32") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw.xor)
)

(func $xor64 (export "xor64") (param $p0 i32) (param $p1 i64) (result i64)
  (local.get $p0)
  (local.get $p1)
  (i64.atomic.rmw.xor)
)

(func $exchange8 (export "exchange8") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw8.xchg_u)
)

(func $exchange16 (export "exchange16") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw16.xchg_u)
)

(func $exchange32 (export "exchange32") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i32.atomic.rmw.xchg)
)

(func $exchange64 (export "exchange64") (param $p0 i32) (param $p1 i64) (result i64)
  (local.get $p0)
  (local.get $p1)
  (i64.atomic.rmw.xchg)
)

(func $compare_exchange8 (export "compare_exchange8") (param $p0 i32) (param $p1 i32) (param $p2 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (local.get $p2)
  (i32.atomic.rmw8.cmpxchg_u)
)

(func $compare_exchange16 (export "compare_exchange16") (param $p0 i32) (param $p1 i32) (param $p2 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (local.get $p2)
  (i32.atomic.rmw16.cmpxchg_u)
)

(func $compare_exchange32 (export "compare_exchange32") (param $p0 i32) (param $p1 i32) (param $p2 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (local.get $p2)
  (i32.atomic.rmw.cmpxchg)
)

(func $compare_exchange64 (export "compare_exchange64") (param $p0 i32) (param $p1 i64) (param $p2 i64) (result i64)
  (local.get $p0)
  (local.get $p1)
  (local.get $p2)
  (i64.atomic.rmw.cmpxchg)
)

(func $notify (export "notify") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (memory.atomic.notify)
)

(func $wait (export "wait") (param $p0 i32) (param $p1 i32) (result i32)
  (local.get $p0)
  (local.get $p1)
  (i64.const -1)
  (memory.atomic.wait32)
)

(func $waitTimeout (export "waitTimeout") (param $p0 i32) (param $p1 i32) (param $p2 i64) (result i32)
  (local.get $p0)
  (local.get $p1)
  (local.get $p2)
  (memory.atomic.wait32)
)
`
